package pacBioSimple;

import tools.sequences.sequenceUtils;

//import java.util.ArrayList;
//import java.util.List;
//import java.util.concurrent.Callable;
//import java.util.concurrent.ExecutionException;
//import java.util.concurrent.ExecutorService;
//import java.util.concurrent.Executors;
//import java.util.concurrent.Future;

public class TracebackTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String a = "GAGAGTATCTCAAATGGTTATGTTCGAAGGAATCGAGTTTGAGAGATATGTGATTACCCATATGGAGCATCTTGCCGCAATGTAGATAAGATTTTGTTGTTCCCCTGGCTTCTTCTCGGTTTCCTTGTTGTCCATGGCCGATTCGTTCCACAACTTGCTTTCTAAAATTCAACCTAATTTGTTCCGTTCGTCCTCTTTAAGTTAACGCTATTGTTTCTTCCAGTCTGCTATACTACTAAAAATATATAAGATGAATAGAAAGAATAAGGTAAACTAAAGAAAAATGGAAAAATCAAATTATAATGTAAACTTGAGTTTTAGAAAGAAATAAGGTAAACTTGAAAATGATAAAAAGCAAAACAAATTATGTTAATTTTTGTAAGATCCAAATTATATTTCATAATTTCATTTAAGTTTCTAGATAAATTATCAACCTTCAACCTCAATTTTTTTTTGTAAGGGTAATAACAAAGGTGTTTGATTGACCGTTTTGTGTTTCTGCATCCTCCTAAATTTTGGATATTATAACTTTTAAAAATCTGAGATCAAAGCTCATTAGGGCATGCGTCATCAACTTTGGGATCTTCCAAGAACCAGAATTTCAAAATATGGTCTACATGATTTAATCTTGATGGATTGTGGAGGCAAGCAACAAATGTATCTTCTTATGTTTTTTGTAATGATTTTCTTCTGTTTTATCTTACCCTCTAAAAACTAAAGAGAAGAAGTTCTGTTTTCTTCTGATTTGCCAAACCTTATACAACTAAAAAACTTATTGGGACTTGGAAAGTTATCCAATAATATCAAGGCACACCAAATCAAGGGAAAAGGTCCAAATAAAGGATGACAACACAAGGCAAAAAATGTATAAGGAATGATCAAGTAACGAACAACAAGAAAAATTCAAAGATATAAAAAGAGGTATAATTGTTGCATCAAAGTTAAGTTTCACTATCATTGAGCTATGAAGGCGCTGCTTTAGAAGACACAAAGAGTCTCGATGTGGTTTGGAAAAAAAACATGTTTGTATATAACCGTCCGTTCTTTATATCTTCTCTCAACAACAACAACGGGGAGGAGGAAAGTAAAAAGAGGAGATATAAAGACGACGGTTTATACAACATGTATTTTTTTCCAAACCACATCGAGACTTCTGTGTCTTTCTAAAGCAGCGCCTTCATAGCTTCAATGATCAGTGAAACTTACTTTTGAATGCAACCAATTATAACTCTTTTTTATACTTTGATTTTCTTTGTGTCGTTACTGATTCTTCCTTTAAAATTTTTGCTTTAGTGTTTGTAATCTTTATTTGACCTTTCCTGATTTTGGTGTGCCTTGGTATATTATTGATAACTTCAAGTCCCAACCATAAAGTTTCTGAGTTGTAATAAAGGTATTGGAATCAAAGAAACAGAAACTTCTTCACTAGTTTTAGAGTGTAAGATAAAGAAAATCATTACAAACATGAAGAAGATACACCATGTTGCTTTGCCCACAAAATCCATCAAAATTAACATCTGTAAAACCATATGAAATTCTTTCTTGGAAGATCCCAAGTTGACCTTTGAAAGCAATGCCCCTGTAATGAGCTTTGATCTCAGATTTTAAAAGTTAAGAATTATCTCCCAAAATTTGGAGATGCAGAAAATCACAAACGGGTCAATACAAAACATTTTTGTAATTACCCTTAACAAAAAAAAAAATGGGAAGTTGAAGGTTGTATATCTAAAACTAATAAAATAGAAATTATGAATATTAATTTGGATAATACAATTACATAATTTGGTTTTTGCTTTTTTATCCTTTTTTCAGTTTACCTAAATATACAGATATCAAACTCAGTTTACATATATTTGATTTTTTCCCCATTTCCCTTTCAAGTTTACCTTATTCTTCTATTCATCTTATAAATTTAGTAGTAATAGCAGACGAAGAACAAATAAGCGTTTAACTTAAAGAAGACGAACGAAACAAAATTAGGTGAATTTAAGAAAGCAAGATTGTGAACGATCGCCATGGAAAACAAGACAAGAAGAAGCAGGAACAACCAAAATCTTCAATCTACATTGACGACAAAGATGCCTCACATGTAAATCACATATCCAGTCAAACTCGATTCTCCTCGACATAACATTGAGATACTCTTCAAGACTTCCTGCGAAATCATCGTCAGATCTCGCTCCGTCTCTAAGCTCTGTCAGTCGCCATACCACCACAGCCAGAGTTTCATCAAGCATCGATCTCTCTCAACAACAACAACGGAGGAGGGAGGAAAAGAGAGAGATCGATGCTTGAAGAACTCTGGTGTGGGGATGGACGACCAGAGCTAGAGACGGAGCGAGATCCTGACGATTGATTTCGCAGGATCTTGAAGTATCTCATGGTTAGTCCGAGAGAATCGAGTTTGACGAGAAATGTGATTACATTGTGAGCATCTTCGGTCAATGAGATGAAGATTTTGTTGTTCCCTGCTATCTTCTCGTCTTGTTGTTCCATGGCCGATGTTCCACAATCTTGCTTTCCTTAAAAGTCACTAATTTGTTCGTCGTCTCTTTAAGTTAACGCTTATTTGTTCTTCCCGTCTGCTAATACTACTAAATATAATAAGAATGAATTAGAAAGAAATAAGGTAAACTTGAAAAGGAAAAATGGAAAAATCAAATATATGTAAACTGAGTTAGAAAGAAATAAGGTAAACTTGAAAAGGATAAAGCAAAAACAAATTTATGTTAATTGTAAATATCCATAATTAAAAATTCATAATTTCTATTTTATAGTTTTAGATATAAACCTTCAACTTCCATTTTTTTTGTAAGGGTAAATTAACAAAAGTGTTTGTATGACCGGTTGTATTTCTGCATCCTCCAATTTGATAATTCTACTTTTAAAATCGAGATTCAAAAGCCATTAGGCATGCTTCAAAAGTCAACTTGGGATCTCAAGAACGAATTTCATATGGTTCTTACAGATGTTAATCTTGATGGATTGTGAGCAAGCAACAATGGTTTATCTCTTCATGTTTGTAATGATTTCTTCTTATCTACCTCAAACTAAGAGAAGAAGTTTCTGTTCTGATTTGCCAAACTTTATACAATCAGAATATGTTGGGACTTGAAGTTATCCAATAATATACAAAGGCACACCAAATCAAAGGAAAGGTCAAAATAAAGATTACAAACACTAAAGGCAAAAATTATAAAGGAATGATCAAGTAACGAACACAAGAAAATCAAGATATAAAAAGAGTTATAATTGTTGCATCAAAGTAAGTTCACTGACATTGAGCTAATGAGGCGCTGCTTTAGAAAGCACAAAGAGTCTCGATGGGTTGGAAAAAAAAACATGTTGTAAAACCGTCGTCTTTATATCTCTCTCAACAACAACAACGGAGGAGGAGGAAAAAGAGAGATTATAAAGACGACGGTTTATACAACATGTATTTTTTTCCAACCACATCGAGACTTCTTGTGGTCTTCTTAAGCAGCGCCTCATAGCTTTCAAGATCAGTGAAACTTACTTTTTGATGCAACAATTATAACTCTTTTTATTCTTTGATTTCTGTGTTCGTTAACTTGAATCATTCCTTTATAATTTTTTGCCATTTAGTGTTTTAACTTATTGACCTTTCCTTGATTTGGTGCTGCCTTTGTAATATATTGATAGACTCAAGTCCCACATAAGCTTTCTGAGTGTATAAAGGTTTGCAAATCAGAAACCAGAACTTCTTTTCTCTTAGTTAGAGGGTAAGATTAAAGAAGAATCAATTAGAAAACATGAAGAAGATACCTATGTTGCTTGCTCCCACAATCCATCAAATAACATCTGTAAGACCATATGAAATCTGTTTTTAGGAGATCCCAAGTTGACTTGAAGCCATGCCCTAGATGAGCTTTGATCTCAGTATTTTAAAAGTAAATGTACCAAATTTGGAGGATCAGAAAATCACAAACGTCATACAAAATTTTGTAATTACCCTTACAAAAAAAAATGGAAGTGAAGGGTTTGGTATATCTAAAACTATAAAATAGAAATATGAAATATTAATTTGATATACAATTAACATAATTTTTTTGCTTTTAATCCTTTTCAAAGTTTACCTATTTCTTTCTAACCAAGTTTACATAAATTGATTTTTTTCCATTTTTCCTTTCAAGTTTTTACCTATTTCTTCTATCCATCTTATATATTAGTAGTATATGGAGCAGACGGAAGAACAAAATAAGCGTTAACTTAAAGAAGACGAACGAAAAATAGTAATTTTTGAAAGCAAGATGTGGAACGATCGCATGGACAAAACAAGACGAGAGAAGCACAGGGACAACAAATCTTCATCTACATTGACGACAAGATGCTCACAGGTAATCACATATCTCAGCAAACTCGATTCTCTCGACAAATAACCATTGAGATACCTCAAGACGTCCTGCGAAATCAATCGTCAATCTCGCTAAAAAACAAACCCCCCTTAAAGGTAAAATGAA";
		String b = "GAGACAGACACGAATGGATGCATAAACACTTTGTTTTACCTCTTTCTGGGACACACCCAATACGAAGGAAACATCTACATTTCAAGGGTGTTAGTGATGCTGGTGTGCTTGCTTATTTTTGCTTCACAGAGTTTGTCTAAATCGTTTTATATTCTACATTTTAGGCGATGAATTTAGGTGCCGTTATGGACTTGATAAAGACGACGGTTTATACAACATGTATTTTTTTCCAAACCACATCGAGACTCTTGTGTCTTTCTAAAGCAGCGCCTTCATAGCTCAATGATCAGTGAAACTTACTTTTGATGCAACAATTATAACTCTTTTTATATCTTTGATTTTTCTTGTGTTCGTTACTTGATCATTCCTTTATAAATTTTTTGCCTTTAGTGTTTGTAATCTTTATTTGACCTTTCCTTGATTTGGTGTGCCTTTGTATATTATTGGATAACTTCAAGTCCCAACATAAGTTTCTGAGTTGTATAAAGGTTTGGCAAATCAGAAACAGAACTTCTTCTCTTAGTTTAGAGGGTAAGATAAAGAAGAATCATTACAAAACATGAAGAAGATAACCATGTTGCTTGCTCCACAATCCATCAAGATTAACATCTGTAAGAACCATATGAAATTCTGTTCTTGGAGATCCCAAGTTGACTTTGAAGCATGCCCTAATGAGCTTTGATCTCAGATTTTAAAAGTAGAATTATCCAAATTTGGAGGATGCAGAAAATCACAAACGGTCAATACAAACACTTTTGTTAATTACCCTTACAAAAAAAAATGGAAGTTGAAGGGTTGTATATCTAAAACTATAAAATAGAAATTATGAAATATTAATTTGGATAATTACAATTAACATAATTTGTTTTTGCTTTTTATCCTTTTCAAGTTTACCTTATTTCTTTCTAACTTTCAAGTTTACCTTATTCTTCTATTCATCTTATAAATTTAGTAGTAATAGCAGACGAAGAACAAATAAGCGTTTAACTTAAAGAAGACGAACGAAACAAAATTAGGTGAATTTAAGAAAGCAAGATTGTGAACGATCGCCATGGAAAACAAGACAAGAAGAAGCAGGAACAACCAAAATCTTCAATCTACATTGACGACAAAGATGCCTCACATGTAAATCACATATCCAGTCAAACTCGATTCTCCTCGACATAACATTTGAGATACTCTCAAGACTTCCTGCGAAATCAATCGTCAGATCTCGCTCCGTCTCTAAGCTCTGGTCGTCCATTACCACCACACCAGAGTTCATCAAGCATCGGTCCAAGAAGACATCACCACCTTGTGTTCTACTAATCTTCCGAAAACACGACAAGCTGATCGTTTTCTCGTCTCCCCAACACCAGAATACTTATTCTCATGTGCAAGATTATCACATTGAAATCCCCAAGAATGGTTTCATCCGTCGTCTTGATTCCGTCCACGGTTTGATCTGCTTAGAAGGTTCTAAACAGCTCGTGATTTGTAACCCTACTTTGAAACGATTCTTCCCTTTACCTGAGCCTCAAGGCACCGGTGACGAATACAACGTAGGAGGGTTTCTGGGATATGAACCGATAGAGGGTAAATACAAAGCATTGTGCATTGTCAGAGGATGGAACACTCAAGTTCTTACATTGGAAATTCAAGAATCATGGAGAGTAACCAAACCTGGCTATACACATTGGCCTACTAAAGATACTGGACGATGCATTAATGGAGTTATCTACTATAAAGCTATTATATTTGATAGGGTTCCAAGGCATGTTATATTTGTTAGAAAGAAATAAGGTAAACTTGAAAAGGAAAAATGGAAAAATCAAATTATATGTAAACTTGAGTTAGAAAGAAATAAGGTAAACTTGAAAAGGAAAAATGGAAAAATCAAATTATATGTAAACTTGAGTTAGAAAGAAATAAGGTAAACTTGAAAAGGATTAATTGTAAATATCCATAATTAAAAATTCTCATAATTTCTATTTTATAGTTTTAGATATACAACCCTTCAACTTCCATTTTTTTTTGTAAGGGTAATTAACAAAAGTGTTTGTATTGACCGTTTGTGATTTTCTGCATCCTCCAAATTTGGATAATTCTACTTTTAAAATCTGAGATCAAAGCTCATTAGGGCATGCTTCAAAGTCAACTTGGGATCTCCAAGAACAGAATTTCATATGGTTCTTACAGATGTTAATCTTGATGGATTGTGGAGCAAGCAACATGGTTATCTTCTTCATGTTTTGTAATGATTCTTCTTTATCTTACCCTCTAAACTAAGAGAAGAAGTTCTGTTTCTGATTTGCCAAACCTTTATACAACTCAGAAACTTATGTTGGGACTTGAAGTTATCCAATAATATACAAAGGCACACCAAATCAAGGAAAGGTCAAATAAAGATTACAAACACTAAAGGCAAAAAATTTATAAAGGAATGATCAAGTAACGAACACAAGAAAAATCAAAGATATAAAAAGAGTTATAATTGTTGCATCAAAAGTAAGTTTCACTGATCATTGAGCTATGAAGGCGCTGCTTTAGAAAGACACAAGAGTCTCGATGTGGTTTGGAAAAAAATACATGTTGTATAAACCGTCGTCTTTATCAAGTCCATAACGGCACCTAAATTCATCGCCTAAAATGTAGAATATAAAACGATTTAGACAAACTCTGTGAAGCAAAAATAAGCAAGCACACCAG";

//		ExecutorService executor = Executors.newFixedThreadPool(2);
//		List<Future<AlignmentObject>> list = new ArrayList<Future<AlignmentObject>>();
		
		AlignmentObject tempWorker = new AlignmentObject();
		StringBuilder sb = new StringBuilder(a);
		StringBuilder sb2 = new StringBuilder(b);
		//sb =sequenceUtils.reverseComplement2(sb);
		//sb2=sequenceUtils.reverseComplement2(sb2);
		tempWorker.setA(sb2.toString());
		tempWorker.setTemplate(sb.toString());
		tempWorker.setGap(2);
		tempWorker.setEx(1);
		
//		Callable<AlignmentObject> worker = new ThreadAlignmentTraceback(tempWorker);
//		Future<AlignmentObject> submit = executor.submit(worker);
//		list.add(submit);
		
		System.out.println(tempWorker.getA());
		System.out.println(tempWorker.getTemplate());
	
		AlignmentObject p= new NeedlemanWunsch(tempWorker).affineCompareWithTraceBack();
		//executor.shutdown();
		
//		try {
//			p = list.get(0).get();
//		} catch (InterruptedException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		} catch (ExecutionException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
		
		System.out.println(p.getTemplate());
		System.out.println(p.getA());
		System.out.println(p.getScore());
	}

}
